/**
 * Copyright (c) 2013-2022 Nikita Koksharov
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.redisson.config;

import org.springframework.beans.factory.BeanFactory;


/**
 * RedissonNodeConfig类，用于配置Redisson节点。
 * 继承自RedissonNodeFileConfig，增加了对BeanFactory的支持。
 */
public class RedissonNodeConfig extends RedissonNodeFileConfig {

    private BeanFactory beanFactory; // 用于存储BeanFactory实例

    /**
     * 默认构造函数，创建一个空的RedissonNodeConfig实例。
     */
    public RedissonNodeConfig() {
        super();
    }

    /**
     * 基于现有Config对象构造函数。
     * @param oldConf 旧的Config配置对象，用于初始化当前实例。
     */
    public RedissonNodeConfig(Config oldConf) {
        super(oldConf);
    }

    /**
     * 基于现有的RedissonNodeConfig对象构造函数。
     * @param oldConf 旧的RedissonNodeConfig配置对象，用于初始化当前实例，包括beanFactory。
     */
    public RedissonNodeConfig(RedissonNodeConfig oldConf) {
        super(oldConf);
        this.beanFactory = oldConf.beanFactory; // 从旧配置中复制beanFactory
    }

    /**
     * 获取当前实例的BeanFactory。
     * @return 返回配置的BeanFactory对象。
     */
    public BeanFactory getBeanFactory() {
        return beanFactory;
    }

    /**
     * 设置当前实例的BeanFactory。
     * @param beanFactory 要设置的BeanFactory对象。
     */
    public void setBeanFactory(BeanFactory beanFactory) {
        this.beanFactory = beanFactory;
    }

}

